//
//  EditMessagePerVC.m
//  LoveTrail
//
//  Created by giantumbrella on 15/6/11.
//  Copyright (c) 2015年 赵娟. All rights reserved.
//

#import "EditMessagePerVC.h"
#import "CommonMacro.h"

@interface EditMessagePerVC ()<UITextFieldDelegate>{
    NSArray *dataArray;
    NSArray *babyArray;
    NSDictionary *param;
    NSString *tempValue;
}

@property (nonatomic,strong) UITextField *textField;
@end

@implementation EditMessagePerVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"编辑个人信息";
    self.view.backgroundColor = [UIColor whiteColor];
    //添加东西
    [self addSubViews];
}

#pragma mark 创建tableView
- (void)addSubViews
{
    //左侧按钮
    UIBarButtonItem *leftButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"_0001_购物车"] style:UIBarButtonItemStyleDone target:self action:@selector(backUpView)];
    self.navigationItem.leftBarButtonItem = leftButton;
    
    //右侧按钮
    UIBarButtonItem *rightButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"保存" style:UIBarButtonItemStylePlain target:self action:@selector(saveDataAndBack:)];
    self.navigationItem.rightBarButtonItem = rightButtonItem;
    
    self.textField = [[UITextField alloc] initWithFrame:CGRectMake(5, 70, SCREEN_WIDTH-10, 30)];
    self.textField.backgroundColor = [UIColor redColor];
    [self.view addSubview:self.textField];
    self.textField.delegate = self;
    
   
  
}

#pragma mark 返回
- (void)backUpView
{
    
    [self.navigationController popViewControllerAnimated:YES];
}

#pragma mark 保存 返回上
- (void)saveDataAndBack:(NSString *)temp
{
    if ([self.delegate respondsToSelector:@selector(valuePassToUpView:)]) {
        [self.delegate valuePassToUpView:self.textField.text];
    }
    [self.navigationController popViewControllerAnimated:YES];
}


- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
    [self.textField endEditing:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

@end
